#define DEBUG
#include <cstdio>
#define MAXN 1000000

using namespace std;

int min(int a, int b) {
  return a<b ? a : b;
}

int main() {
#ifdef DEBUG
  freopen("2.in", "r", stdin);
  freopen("2.out", "w", stdout);
#endif

  int n, m, k;
  scanf("%d %d %d", &n, &m, &k);

  for (int tm=1; tm<=m; tm++) {
    printf("m=%d:\n", tm);
    for (int tk=1; tk<=k; tk++) {
      for (int tn = 1; tn<=n; tn++) {
	static int f[MAXN+1];
	f[0] = 1;
	int sum = 1;
	for (int i=1; i<=tn; i++) {
	  if (i>tm) {
	    sum -= f[i-tm-1];
	  }
	  f[i] = min(tk-sum, i>=tm ? sum-f[i-tm] : sum);
	  sum += f[i];
	}

	printf("%d ", tn>=tm ? sum-f[tn-tm] : sum);
      }
      printf("\n");
    }
    printf("\n");
  }

  fcloseall();
  return 0;
}
